package com.dianxin.smartpark.web.visitor;

import java.util.List;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.visitor.SmartParkVisitorSpecialUserQO;
import com.dianxin.smartpark.service.visitor.SmartParkVisitorSpecialUserService;
import com.dianxin.smartpark.service.vo.visitor.SmartParkVisitorSpecialUserVO;
import com.dianxin.sso.client.annotation.RecordLog;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 特殊用户
 * 
 * @author chenjiasong
 * @date 2021-08-04
 */
@RestController
@RequestMapping("/smartpark/user")
public class SmartParkVisitorSpecialUserController
{
    @Resource
    private SmartParkVisitorSpecialUserService smartParkVisitorSpecialUserService;

    /**
     * 查询特殊用户列表
     */
    @GetMapping("/list")
    @SaCheckPermission(value = "/smartpark/user/list")
    public CommonResponseBody<List<SmartParkVisitorSpecialUserVO>>  list(SmartParkVisitorSpecialUserQO qo)
    {
        return smartParkVisitorSpecialUserService.selectSmartParkVisitorSpecialUserList(qo);
    }


    /**
     * 获取特殊用户详细信息
     */
    @GetMapping(value = "/getInfo")
    @SaCheckPermission(value = "/smartpark/user/getInfo")
    public CommonResponseBody<SmartParkVisitorSpecialUserVO> getInfo(SmartParkVisitorSpecialUserQO qo)
    {
        return smartParkVisitorSpecialUserService.selectSmartParkVisitorSpecialUser(qo);
    }

    /**
     * 新增特殊用户
     */
    @PostMapping("/add")
    @SaCheckPermission(value = "/smartpark/user/add")
    @RecordLog(name = "新增特殊用户")
    public  CommonResponseBody<Boolean> add(@RequestBody SmartParkVisitorSpecialUserVO vo)
    {
        return smartParkVisitorSpecialUserService.insertSmartParkVisitorSpecialUser(vo);
    }

    /**
     * 修改特殊用户
     */
    @PutMapping("/edit")
    @SaCheckPermission(value = "/smartpark/user/edit")
    @RecordLog(name = "修改特殊用户")
    public  CommonResponseBody<Boolean> edit(@RequestBody SmartParkVisitorSpecialUserVO vo)
    {
        return smartParkVisitorSpecialUserService.updateSmartParkVisitorSpecialUser(vo);
    }

    /**
     * 删除特殊用户
     */
	@DeleteMapping("/remove")
    @SaCheckPermission(value = "/smartpark/user/remove")
    @RecordLog(name = "删除特殊用户")
    public  CommonResponseBody<Boolean> remove(@RequestBody SmartParkVisitorSpecialUserVO vo)
    {
        return smartParkVisitorSpecialUserService.deleteSmartParkVisitorSpecialUser(vo);
    }
}
